import RoomPlanContainer from '../../components/roomPlan/RoomPlanContainer'


import { WeaDialog, WeaNewScroll } from 'ecCom';
import { inject, observer } from 'mobx-react';
import { observable, action, toJS } from 'mobx';
import {WeaLocaleProvider} from 'ecCom';
const getLabel = WeaLocaleProvider.getLabel;
@inject('meetingDialog')
@observer
export default class RoomPlan extends React.Component {
  constructor(props) {
    super(props);
    this.state={
      zIndex:801,
      preventCycle:false,
    }
    // this.clickTree = ::this.clickTree;
  }
  componentWillReceiveProps(nextProps) {
    if(this.state.zIndex != nextProps.zIndex){
			this.setState({ zIndex: nextProps.zIndex })
			
    }
    if(this.state.preventCycle != nextProps.preventCycle){
			this.setState({ preventCycle: nextProps.preventCycle })
			
		}
  }
  componentDidUpdate(prevProps, prevState) {

  }

  render() {
    let {visible=false} = this.props;
    let {setRoomPlan, dialogStatus } = this.props.meetingDialog
    let {zIndex, preventCycle} = this.state;
    // let {zIndex } = toJS(dialogStatus)
    // let copyzIndex = zIndex;
    let test1 = new Date()
		let test1Copy = test1.getTime();
    return (
      <div>
      {visible && <WeaDialog
        /* zIndex={test1Copy} */
        visible={visible}
        title={getLabel(15881,'会议室使用情况')}
        className="roomPlanDialog"
        icon="icon-coms-meeting"
        iconBgcolor="#f14a2d"
        style={{ width: '890px', height: '600px' }}
        onCancel={() => {setRoomPlan(false)}}
      >
        {visible && !preventCycle && <RoomPlanContainer  zIndex={zIndex+1} mySelf={false} {...this.props} /> }
      </WeaDialog>}
      </div>
    );
  }
}